import request from "@/utils/request";

const AuthAPI = {
  /** 登录接口*/
  login(data) {
    return request({
      url: '/user/login',
      method: "post",
      data: data,
    });
  },

  /** 刷新 token 接口*/
  refreshToken(refreshToken) {
    return request({
      url: '/refresh-token',
      method: "post",
      params: { refreshToken: refreshToken },
      headers: {
        Authorization: "no-auth",
      },
    });
  },

  /** 注销登录接口 */
  logout() {
    return request({
      url: '/user/logout',
      method: 'post'
    });
  },

  /** 微信登录*/
  wxlogin(wxcode) {
    const data = {
      wxcode,
    }
    return request({
      url: '/user/wxlogin',
      method: 'post',
      data: data
    })
  },
};

export default AuthAPI;
